Repository navigation
✨ feat: sign out of this device - #83
Merged
Merged
Conversation
There was no way to leave. "Desconectar" revoked the token and left the vault open on screen; "Bloquear" kept everything; and the wipe in Advanced, the closest thing to a sign-out, left the encrypted attachment cache and the invite identity on disk, with the token still live in memory. Its confirmation also promised that "the copy in the cloud stays intact" to people whose vault had never been uploaded. Sair deste aparelho now sits beside the account in the sidebar, and on the unlock screen for whoever is looking at someone else's. It removes everything of the person's from the browser — vault cache, stored key, attachment cache, invite identity, account, shared vaults, recent types — and revokes the token. Configuration and looks stay. It will not destroy data to do it. Pending edits are synced first, and if they cannot go up the person is told why before anything is deleted. A vault that was never uploaded is the only copy there is, so signing out refuses outright; the wipe in Advanced can still remove it, after saying in so many words that it is gone for good. Both doors go through one implementation and one set of words. Knowing what is pending after a reload needed the pending-sync flag to survive one, so it is now written synchronously beside the in-memory copy the sync loop already kept.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Edgar missed a logout. There wasn't one — and the three things that looked like one each fell short:
clearCiphertext()andclearIdentity()already existed, with tests — nothing in the app called them.And the old wipe's confirmation read "A cópia no Google Drive permanece intacta e pode ser baixada de novo" — to everyone, including people whose vault had never been uploaded, for whom pressing OK meant losing it forever.
What it does now
Sair deste aparelho sits beside the account at the bottom of the sidebar (inside the drawer on phones), and on the unlock screen for whoever is looking at someone else's lock screen. It removes everything of the person's from the browser — vault cache, stored key, attachment cache, invite identity, account, shared vaults, recent types — and revokes the token. Configuration (client ids) and looks (theme) stay.
It will not destroy data to do it
assessSignOutis a pure function and the heart of this:Both doors go through
signOutFlow, so the words cannot drift between them.Knowing what is pending after a reload needed the pending flag to survive one. The sync loop kept it in memory only; it is now written synchronously beside that, through one
setPendinghelper at all five sites.Tests
Unit:
assessSignOutand the prompt wording (8), pluswipeLocalDatapinned to what it removes and what it keeps — a fork's client id and the theme must survive. Three mutations, three failures.Smoke, eight new checks, reading the disk rather than the screen — the smoke vault was never uploaded, which makes it the case that matters most:
The first check exists so the others cannot pass on a device that never had anything to delete.
My first mutation run lied to me. Deleting the two calls left their imports unused,
tscfailed insidenpm run build,vite buildnever ran, and the smoke tested the olddist/— green. Rerun with a mutation that still compiles, and a changed bundle hash confirmed:Two unrelated smoke failures in the final run
vence em breve traz só o cartão a renovarandbadge de validade aparece na linha também no celularfailed because I ran the suite at 00:03. They are a pre-existing DST bug indaysUntil: it divides milliseconds by 24 hours, and 25 October 2026 is the night Portugal turns the clock back, a 25-hour day. Between 00:00 and 01:00, any date past a DST fallback counts one day too many:Not part of this change. Fixing it separately.
npm test400 green · the eight sign-out checks green.Also fixed while here: the unlock screen's reconnect button said "Reconectar conta Google" to OneDrive users.